package cuongnh.project.japanesediary.vocabulary.ui.perspective;

import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import cuongnh.project.japanesediary.vocabulary.ui.view.CategoryGrammarsView;
import cuongnh.project.japanesediary.vocabulary.ui.view.CategoryKanjisView;
import cuongnh.project.japanesediary.vocabulary.ui.view.CategoryListView;
import cuongnh.project.japanesediary.vocabulary.ui.view.CategorySentencesView;
import cuongnh.project.japanesediary.vocabulary.ui.view.CategoryVocabulariesView;
import org.eclipse.ui.IFolderLayout;

public class CategoryPerspective implements IPerspectiveFactory {

	@Override
	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.setEditorAreaVisible(false);

		// leftFolder
		IFolderLayout leftFolder = layout.createFolder("leftFolder",
				IPageLayout.LEFT, 0.2f, editorArea);
		leftFolder.addView(CategoryListView.ID);

		// bottomFolder
		IFolderLayout bottomFolder = layout.createFolder("bottomFolder",
				IPageLayout.BOTTOM, 0.5f, editorArea);
		bottomFolder.addView(CategorySentencesView.ID);
		bottomFolder.addView(CategoryGrammarsView.ID);

		// rightFolder
		IFolderLayout rightFolder = layout.createFolder("rightFolder",
				IPageLayout.TOP, 0.5f, "bottomFolder");
		rightFolder.addView(CategoryVocabulariesView.ID);
		rightFolder.addView(CategoryKanjisView.ID);

		layout.getViewLayout(CategoryListView.ID).setCloseable(false);

	}

}
